import { createRouter,createWebHashHistory } from 'vue-router'
 
const routes = [
    { path: '/', name: '基础', component: () => import('@/pages/Basic.vue') },
    { 
        path: '/charts', 
        name: '图表', 
        component: () => import('@/pages/Charts.vue'),
        children: [
            {
                path: 'pie',
                name: '饼状图',
                component: () => import('@/components/pie.vue')
            },
            {
                path: 'realtime',
                name: '实时排序',
                component: () => import('@/components/realtime.vue')
            }
        ] 
    },
    { 
        path: '/three', 
        name: '3D', 
        component: () => import('@/pages/Three.vue'),
        children: [
            {
                path: 'scene1',
                name: '场景1',
                component: () => import('@/components/scene1.vue')
            },
            {
                path: 'scene2',
                name: '场景2',
                component: () => import('@/components/scene2.vue')
            }
        ] 
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes, 
})

export {
    routes,
    router
}